package com.undsf.comikamij.core;

import com.undsf.comikamij.core.entities.Book;
import com.undsf.comikamij.core.entities.Chapter;
import com.undsf.comikamij.core.entities.Comic;
import com.undsf.comikamij.core.entities.Page;
import com.undsf.ezhttp.CachedHttpClient;

import java.util.List;

/**
 * Created by MaiBenBen on 2017/4/7.
 */
public abstract class BaseCrawler {
    protected CachedHttpClient client;

    public BaseCrawler() {
        client = new CachedHttpClient("Z:\\tmp\\ezhttp\\cache");
    }

    /**
     * 获取所有作品
     * @return
     */
    public abstract List<Comic> crawlIndex();

    /**
     * 根据ID获取该作品的章节目录（TOC）
     * @param id
     * @return
     */
    public abstract List<Chapter> crawlTOC(String id);

    /**
     * 爬取指定作品指定章节中所有的页面
     * @param comic
     * @param chapter
     * @return
     */
    public abstract List<Page> crawlPagesOfChapter(String comic, String chapter);
}
